package com.yyt.module_main.vm;

import android.databinding.ObservableField;
import android.databinding.ObservableInt;
import android.os.Bundle;
import android.view.View;

import com.yyt.libsrc.helper.LocalHelper;
import com.yyt.libsrc.router.RouteTable;
import com.yyt.libsrc.router.RouterHelper;

import top.lixb.libcommon.binding.BindingViewModel;

public class MemberSettingVM extends BindingViewModel {
    public ObservableField<String> iconUrl = new ObservableField<>();
    public ObservableField<String> name = new ObservableField<>();
    public ObservableField<String> sid = new ObservableField<>();
    public ObservableInt role = new ObservableInt();
    public ObservableField<String> feeRate = new ObservableField<>("0.01");


    public void changeRate(View view) {
        int myRole = LocalHelper.getMyRole();
        double myrate = Double.parseDouble(LocalHelper.getMyrate());
        Bundle bundle = new Bundle();
        bundle.putInt("myrole",myRole);
        bundle.putDouble("myrate",myrate);
        bundle.putInt("role",role.get());
        bundle.putDouble("rate", Double.parseDouble(feeRate.get()));
        bundle.putString("sid",sid.get());
        RouterHelper.getInstance().startAct(RouteTable.main_change_rate,bundle);
    }

    public void setAgent(View view) {

    }
}
